Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: validate new issues GHA #2190

Merged
merged 8 commits into from
Jun 12, 2023
Merged

feat: validate new issues GHA #2190

merged 8 commits into from
Jun 12, 2023

Conversation

iowillhoit
Copy link
Contributor

Adds a new Github action that validates new issues.
The Action will:

  • Post a comment if sfdx or sf are older than latest
  • Post a comment if the full --verbose version output was not included
  • Add the more information needed label

Here is an example of all 3 cases: https://github.com/iowillhoit/gha-sandbox/issues/22

This PR also updates ISSUE_TEMPLATE

Testing Instructions:

@iowillhoit
Copy link
Contributor Author

@jshackell-sfdc 3 markdown files for review here. The rendered templates can be viewed here: https://github.com/iowillhoit/gha-sandbox/issues/22


### System Information
<!-- Which shell/terminal are you using? (bash, zsh, powershell 7, cmd.exe, etc) -->
<!-- Paste the **full** output of the `version --verbose --json` command below -->
Copy link
Contributor

@mshanemc mshanemc Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: does doctor provide anything better that the version --verbose doesn't that we might want instead or in addition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doctor does some version and plugin checks but it does not actually output any of it. I think we still want to suggest this for now so we get version, plugins, os, node version, etc

Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some code comments and process questions.

required: true
description: "Token taken from secrets env var"
runs:
using: "node16"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd go higher since 16 is EOL in October.

I couldn't tell from the docs if there's a way to specify lts, but that would be best.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not supported yet 😑 actions/runner-images#7002 (comment)
I tried a work around there but it did not seem to work. Going to wait it out and hopefully they will add support

@@ -46,6 +46,21 @@ jobs:
If you require immediate assistance, contact Salesforce Customer Support.
- name: log action output
run: echo ${{steps.run_action.outputs.message}}
validate-new-issue:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I get your auto-response [say I forgot to put my version stuf], and then I modify the issue to include that, will this rerun? I'm thinking no because it's triggered off of new labels.

We'd probably want it to "maintain" the more information required label until the issue meets the criteria (it might not need to comment again if the previous comment still stands, but it could make sure the label stays on)?

Maybe it should be triggered by something else (create/edit of an issue ?)

owner,
repo,
issue_number,
labels: ["more information needed"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what removes the more information needed label? Should it remove investigating

Would it be good if additional info from the user (provided it meets the criteria) would

  1. remove more info
  2. add investigating back ?

I'm trying to think of the easiest way for the Trust project to be accurate more often

.github/actions/validate-issue/index.js Outdated Show resolved Hide resolved
.github/actions/validate-issue/index.js Outdated Show resolved Hide resolved
@iowillhoit
Copy link
Contributor Author

iowillhoit commented Jun 9, 2023

Ok @mshanemc , updated this to add and remove labels. Also added another workflow that will watch for updates to the PR body and comments. I think we have good coverage on scenarios that we will encounter. I will try to monitor this and make sure it is working as expected over the coming weeks.

See the note about adding a validated label.

Testing comments: https://github.com/iowillhoit/gha-sandbox/issues/32
Testing body edit: https://github.com/iowillhoit/gha-sandbox/issues/33
sf and sfdx: https://github.com/iowillhoit/gha-sandbox/issues/34
Testing comment edits: https://github.com/iowillhoit/gha-sandbox/issues/35

Edit:
It also will display multiple non-latest versions if you've shared them. Example: https://github.com/iowillhoit/gha-sandbox/issues/35#issuecomment-1585167460

Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good, thanks for thinking through the label states.

Comment on lines +20 to +28
// Temporary check to prevent this action from running on old issues
// This will prevent noise on tickets already being investigated
// This can be removed once the action has been running for a while
const creationDate = new Date(issue.created_at);
const cutoffDate = new Date("2023-06-11T00:00:00Z");
if (creationDate < cutoffDate) {
console.log("Issue was created before 6/11/2023, skipping");
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing, I added a date check to prevent this from running on old issues. Here is an example of the check failing: https://github.com/iowillhoit/gha-sandbox/actions/runs/5245104855/jobs/9472071608#step:5:8

@iowillhoit iowillhoit merged commit c220c8d into main Jun 12, 2023
@iowillhoit iowillhoit deleted the ew/more-info branch June 12, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants